﻿<ResourceDictionary 
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:primitives="clr-namespace:System.Windows.Controls.Primitives;assembly=PresentationFramework"
    xmlns:ad="clr-namespace:AvalonDock"
    
    >

    <ResourceDictionary.MergedDictionaries>
        <ResourceDictionary Source="/AvalonDock;component/Resources/Brushes.xaml"/>
        <ResourceDictionary Source="/AvalonDock;component/Resources/Common.xaml"/>
    </ResourceDictionary.MergedDictionaries>


	<!--DockableFloatingWindow-->
    <Style x:Key="{x:Type ad:DockableFloatingWindow}" TargetType="{x:Type ad:DockableFloatingWindow}">
        <Setter Property="Title" Value="{Binding RelativeSource={x:Static RelativeSource.Self}, Path=HostedPane.SelectedItem.Title}"/>
        <Setter Property="Background" Value="{DynamicResource {ComponentResourceKey {x:Type ad:DockingManager}, {x:Static ad:AvalonDockBrushes.DefaultBackgroundBrush}}}"/>
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="{x:Type ad:DockableFloatingWindow}">
                    <Border Background="{TemplateBinding Background}">
						<ContentPresenter/>
                    </Border>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

	<!--DocumentFloatingWindow-->
    <Style x:Key="{x:Type ad:DocumentFloatingWindow}" TargetType="{x:Type ad:DocumentFloatingWindow}">
        <Setter Property="Background" Value = "Transparent"/>
        <Setter Property="Width" Value="100"/>
        <Setter Property="Height" Value="100"/>
        <Setter Property="Title" Value="{Binding RelativeSource={x:Static RelativeSource.Self}, Path=HostedPane.SelectedItem.Title}"/>
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="{x:Type ad:DocumentFloatingWindow}">
                    <Grid>
                        <Border 
                            x:Name="PART_HighlighBorder"
                            Visibility="Collapsed"
                            Background="{DynamicResource {x:Static SystemColors.ActiveCaptionBrushKey}}" 
                            Opacity="0.2"/>
                        <ContentPresenter
                            x:Name="PART_Content"
                            ad:ResizingPanel.ResizeWidth="{TemplateBinding ad:ResizingPanel.ResizeWidth}"
                            ad:ResizingPanel.ResizeHeight="{TemplateBinding ad:ResizingPanel.ResizeHeight}"/>
                    </Grid>
                    <!--<ControlTemplate.Triggers>
                        <DataTrigger Binding="{Binding RelativeSource={RelativeSource Self}, Path=IsDocumentFloatingAllowed}" Value="True">
                            <Setter Property="Visibility" Value="Collapsed" TargetName="PART_HighlighBorder"/>
                            <Setter Property="Visibility" Value="Visible" TargetName="PART_Content"/>
                        </DataTrigger>
                    </ControlTemplate.Triggers>-->
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <!--FlyoutPaneWindow-->
    <Style x:Key="{x:Type ad:FlyoutPaneWindow}" TargetType="{x:Type ad:FlyoutPaneWindow}">
        <Setter Property="Background" Value="{DynamicResource {ComponentResourceKey {x:Type ad:DockingManager}, {x:Static ad:AvalonDockBrushes.DefaultBackgroundBrush}}}"/>
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="{x:Type ad:FlyoutPaneWindow}">
                    <Grid Name="INT_resizePanel" Background="{TemplateBinding Background}">
                        <Grid.ColumnDefinitions>
                            <ColumnDefinition Width="Auto"/>
                            <ColumnDefinition Width="*"/>
                            <ColumnDefinition Width="Auto"/>
                        </Grid.ColumnDefinitions>
                        <Grid.RowDefinitions>
                            <RowDefinition Height="Auto"/>
                            <RowDefinition Height="*"/>
                            <RowDefinition Height="Auto"/>
                        </Grid.RowDefinitions>
                        <ContentPresenter Name="INT_pane" Grid.Column="1" Grid.Row="1"/>
                        <ad:Resizer x:Name="PART_Resizer" 
							Background="Transparent"/>                        
                    </Grid>
                    <ControlTemplate.Triggers>
                        <DataTrigger Binding="{Binding RelativeSource={RelativeSource Self}, Path=Anchor}" Value="Right">
                            <Setter Property="Grid.Row" Value="1" TargetName="PART_Resizer"/>
                            <Setter Property="Grid.Column" Value="0" TargetName="PART_Resizer"/>
                            <Setter Property="Width" Value="5" TargetName="PART_Resizer"/>
                            <Setter Property="Cursor" Value="SizeWE" TargetName="PART_Resizer"/>
                        </DataTrigger>
                        <DataTrigger Binding="{Binding RelativeSource={RelativeSource Self}, Path=Anchor}" Value="Left">
                            <Setter Property="Grid.Row" Value="1" TargetName="PART_Resizer"/>
                            <Setter Property="Grid.Column" Value="2" TargetName="PART_Resizer"/>
                            <Setter Property="Width" Value="5" TargetName="PART_Resizer"/>
                            <Setter Property="Cursor" Value="SizeWE" TargetName="PART_Resizer"/>
                        </DataTrigger>
                        <DataTrigger Binding="{Binding RelativeSource={RelativeSource Self}, Path=Anchor}" Value="Bottom">
                            <Setter Property="Grid.Column" Value="1" TargetName="PART_Resizer"/>
                            <Setter Property="Grid.Row" Value="0" TargetName="PART_Resizer"/>
                            <Setter Property="Height" Value="5" TargetName="PART_Resizer"/>
                            <Setter Property="Cursor" Value="SizeNS" TargetName="PART_Resizer"/>
                        </DataTrigger>
                        <DataTrigger Binding="{Binding RelativeSource={RelativeSource Self}, Path=Anchor}" Value="Top">
                            <Setter Property="Grid.Column" Value="1" TargetName="PART_Resizer"/>
                            <Setter Property="Grid.Row" Value="2" TargetName="PART_Resizer"/>
                            <Setter Property="Height" Value="5" TargetName="PART_Resizer"/>
                            <Setter Property="Cursor" Value="SizeNS" TargetName="PART_Resizer"/>
                        </DataTrigger>
                    </ControlTemplate.Triggers>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>
</ResourceDictionary>